package main

import "fmt"

func main() {

	slice := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

	//等同于 [0,len(slice),len(slice)]
	s1 := slice[:]

	fmt.Println(slice, s1)

	s2 := slice[1:5]

	//low 默认为0
	s3 := slice[:5]

	//hight 默认为len(slice)
	s4 := slice[9:]

	s1[0] = 666

	s5 := s3[0:6]

	s5[5] = 888

	//切片修改值之后,数组原始值也会修改
	fmt.Println(slice, s2, s3, s4, s5)

}
